import _Table from "choerodon-ui/pro/lib/table";
import _Button from "choerodon-ui/pro/lib/button";
import _Select from "choerodon-ui/pro/lib/select";
import React, { useContext } from 'react';
import { observer } from 'mobx-react-lite';
import Store from "./stores";
var SortTable = observer(function () {
  var _useContext = useContext(Store),
      sortDataSet = _useContext.sortDataSet;

  var columns = [{
    name: 'fieldName',
    editor: /*#__PURE__*/React.createElement(_Select, {
      searchable: true
    })
  }, {
    name: 'direction',
    editor: true
  }];
  var sortAddBtn = /*#__PURE__*/React.createElement(_Button, {
    funcType: "flat",
    icon: "add",
    key: "sort-add-btn",
    onClick: function onClick() {
      return sortDataSet.create({}, 0);
    }
  }, "\u65B0\u589E");
  return /*#__PURE__*/React.createElement(_Table, {
    header: "\u6392\u5E8F",
    buttons: [sortAddBtn, 'delete'],
    dataSet: sortDataSet,
    columns: columns
  });
});
export default SortTable;